package util

import (
	"mall/service/wpgql/api/internal/graph/model"
)

var RpcSorterFieldMap = map[string]map[string]string{
	RpcEntityNames.BlogPage: {
		string(model.PostObjectsConnectionOrderbyEnumAuthor): "Author",
		string(model.PostObjectsConnectionOrderbyEnumCommentCount): "CommentCount",
		string(model.PostObjectsConnectionOrderbyEnumDate): "Date",
		string(model.PostObjectsConnectionOrderbyEnumIn): "IdIn",
		string(model.PostObjectsConnectionOrderbyEnumMenuOrder): "SortOrder",
		string(model.PostObjectsConnectionOrderbyEnumModified): "Modified",
		string(model.PostObjectsConnectionOrderbyEnumNameIn): "NameIn",
		string(model.PostObjectsConnectionOrderbyEnumParent): "ParentId",
		string(model.PostObjectsConnectionOrderbyEnumSlug): "Slug",
		string(model.PostObjectsConnectionOrderbyEnumTitle): "Title",
	},
	RpcEntityNames.ForumUser: {
		string(model.ForumUserConnectionOrderbyEnumDisplayName):  "DisplayName",
		string(model.ForumUserConnectionOrderbyEnumID):           "Id",
		string(model.ForumUserConnectionOrderbyEnumRegisteredAt): "RegisteredAt",
	},
	RpcEntityNames.ForumPost: {
		string(model.ForumPostConnectionOrderbyEnumID): "Id",
	},
	RpcEntityNames.ForumReaction: {
		string(model.ForumReactionConnectionOrderbyEnumCreatedAt): "CreatedAt",
		string(model.ForumReactionConnectionOrderbyEnumForumID):   "ForumId",
		string(model.ForumReactionConnectionOrderbyEnumID):        "Id",
		string(model.ForumReactionConnectionOrderbyEnumPostID):    "PostId",
		string(model.ForumReactionConnectionOrderbyEnumTopicID):   "TopicId",
		string(model.ForumReactionConnectionOrderbyEnumUserID):    "UserId",
	},
}
